package com.board.servlet.helper;

import org.apache.log4j.Logger;

import com.board.action.Action;
import com.board.action.SimpleAction;
import com.board.action.user.GoOutAction;
import com.board.action.user.LogOutAction;
import com.board.action.user.LoginAction;
import com.board.action.user.RegiAction;
import com.board.action.user.UpdateUserAction;



public class LoginActionFactory implements ActionFactory{
	private static LoginActionFactory factory;
	
	public static LoginActionFactory getInstance(){
		if(factory==null){
			factory=new LoginActionFactory();
		}
		return factory;
	}
	
	public Action getAction(String command){
		Action action=null;
		if(command.equalsIgnoreCase("index")){
			action=new SimpleAction();
		}else if(command.equalsIgnoreCase("regiform")){
			action=new SimpleAction();
		}else if(command.equalsIgnoreCase("regi")){
			action=new RegiAction();
		}else if(command.equalsIgnoreCase("login")){
			action=new LoginAction();
		}else if(command.equalsIgnoreCase("logout")){
			action=new LogOutAction();
		}else if(command.equalsIgnoreCase("bfupdinfo")){
			action=new UpdateUserAction();
		}else if(command.equalsIgnoreCase("updinfo")){
			action=new UpdateUserAction();
		}else if(command.equalsIgnoreCase("bfgoout")){
			action=new GoOutAction();
		}else if(command.equalsIgnoreCase("goout")){
			action=new GoOutAction();
		}else if(command.equalsIgnoreCase("logings")){
			action=new SimpleAction();
		}
		return action;
	}
}
